<?php
//  include_once $_SERVER['DOCUMENT_ROOT'].'/PariGest/pages/inc/entete.php';
  
require_once $REP_CLASS . 'class.Operation.php';
require_once $REP_CLASS . 'class.Compte.php';

try
{
  $operation = new Operation($db);

  $idCompte = "0";
  if( isset($_COOKIE[Compte::$ID_COMPTE_SESSION]) )
  $idCompte = $_COOKIE[Compte::$ID_COMPTE_SESSION];

  $stmt = $operation->selectLastOperation( 10, $idCompte);
  
  $smarty->assign('LstOperations', $stmt->fetchAll());
  $smarty->assign('NbOperations', $stmt->rowCount());
  
  $stmtMontant = $operation->selectMontantLastOperation( 10, $idCompte);
  $resultMontant = $stmtMontant->fetch();
  $smarty->assign('MontantOperations', $resultMontant[0]);
}
catch(MyException $e)
{
  $trace->fb('!!!!! ERREUR !!!!!');
  include $_SERVER['DOCUMENT_ROOT'].'/PariGest/pages/inc/catch.php';
}

  
//  $smarty->display('LastOperations.tpl');
?>
